package top.hmtools.feign.interfaceFeign;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import top.hmtools.feign.domain.UserBean;

//服务消费者，其中配置中的 “eureka-client”见 spring-eureka-client工程中 /spring-eureka-client/src/main/resources/bootstrap.yml配置文件中的 spring.application.name 配置项的值
@FeignClient(value = "${top.hmtools.userinfoService}",fallback=HystrixDemo.class)
public interface SchedualServiceHi {
	
	//目标服务提供者的 uri，几乎同其controller方法一致
	@RequestMapping(value = "/hi", method = RequestMethod.GET,produces={MediaType.TEXT_HTML_VALUE})
	String sayHiFromClientOne(@RequestParam(value = "name") String name);
	
	@RequestMapping(value ="/re", method = RequestMethod.GET)
	public Object re();
	
	@RequestMapping(value ="/re", method = RequestMethod.GET)
	public UserBean re2();
	
	@RequestMapping(value ="/res", method = RequestMethod.GET)
	public Object res();
	
	@RequestMapping(value ="/res", method = RequestMethod.GET)
	public List<UserBean> res2();
	
	@RequestMapping(value ="/mav", method = RequestMethod.GET)
	public Object mav();
}
